function gVar(minMsg) {  	
	//this.minMsg = minMsg;
	this.html = "";
	this.url_twse = "http://www.twse.com.tw/ch/trading/exchange/BWIBBU/BWIBBU_d.php?input_date=98%2F02%2F27&select2=ALL&order=RATIO2&login_btn=%ACd%B8%DF";
	this.url_otc = "http://www.otc.org.tw/ch/stock/aftertrading/peratio_analysis/rsta3103_980311.html";
	this.url_iftu = "http://web.i-fortune.com.tw/stock/tool/engine.cfm?engine=1";
}

gVar.prototype.InitMinMsg = function(__module_id__, div) {
	this.minMsgModuleId = __module_id__;
	this.minMsgDiv = div;
	
	this.minMsg = new _IG_MiniMessage(this.minMsgModuleId, this.minMsgDiv);
	this.prefs = new _IG_Prefs( __module_id__ );
}

gVar.prototype.ResetMinMsg = function() {
	this.minMsgDiv.innerHTML = "";
	_IG_AdjustIFrameHeight();
}

//====================================================
function dbgMsg(msg, erase) {
	if (erase) {
		_gel('dbgmsg_div').innerHTML = msg + "<br>";
	} else {
		_gel('dbgmsg_div').innerHTML += msg + "<br>";
	}
	_IG_AdjustIFrameHeight();
}
//====================================================
function stkdbMsg(msg, erase) {
	//alert(msg+" "+erase);
	if (erase) {
		_gel('stkdbmsg_div').innerHTML = msg + "<br>";
	} else {
		_gel('stkdbmsg_div').innerHTML += msg + "<br>";
	}
	_IG_AdjustIFrameHeight();
}
//====================================================
function stkMsg(msg, erase) {
	//alert("stk");
	if (erase) {
		_gel('stkmsg_div').innerHTML = msg + "<br>";
	} else {
		_gel('stkmsg_div').innerHTML += msg + "<br>";
	}
	_IG_AdjustIFrameHeight();
}
//====================================================
function handleErr(msg,url,line) {
	alert("err: "+msg+"\n"+"url: "+URL+"\n"+"line: "+line);
	return true;
}
//====================================================

function ObjEnumSearch(content) {
	this.content = content;
	this.ptr = 0;
}

ObjEnumSearch.prototype.rewind = function() {
	this.ptr = 0;
}

ObjEnumSearch.prototype.substring_ = function(key1, off1, key2, off2) {
	var substr = "";

	if (this.content.length > 0) {
		var offset = this.content.indexOf(key1, this.ptr);
		if (offset != -1) {
			offset += key1.length + off1;
			var end = this.content.indexOf(key2, offset);
			if (end != -1) {
				substr = this.content.substring(offset, end);
				this.ptr = end;
			}
		}		
	}	
	return substr;
}


